function addsf() {
    var index = layer.open({
        type: 2,
        title: '&nbsp',
        area: ['60%', '40%'],
        fix: true,
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/to_addsf/'
    });
    this.layerIndex = index;
}

function addjg() {
    var index = layer.open({
        type: 2,
        title: '&nbsp',
        area: ['60%', '40%'],
        fix: true,
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/to_addjg/'
    });
    this.layerIndex = index;
}

$("#submit").click(function () {
    var doctor = document.getElementById("doctor").value;   //医生
    var createName = document.getElementById("createName").value;  //创建人
    var remarks = document.getElementById("remarks").value;   //随访内容
    var revisit = document.getElementById("revisit").value;   //随访人员
    var revisitContent = document.getElementById("revisitContent").value;   //随访结果
    var customerId = document.getElementById("customerId").value;
    var reservationsId = document.getElementById("reservationsId").value;   //预约id
    var revisitTime = document.getElementById("revisitTime").value;   //随访时间
    var doctorVisitId = document.getElementById("doctorVisitId").value;   //ID
    if((doctor==null||doctor=="") && (revisit==null||revisit=="")){
        alert("请选择医生或随访人员!");
        return;
    }
    if (revisitTime == null || revisitTime == "") {
        alert("请选择随访时间!");
        return;
    }
    if (remarks == null || remarks == "") {
        alert("请选择随访内容!");
        return;
    }
    $.ajax({
        url: Feng.ctxPath + "/doctorLooked/updateDoctorContent",
        type: "post",
        data: {
            doctor: doctor,
            revisitTime: revisitTime,
            createName: createName,
            remarks: remarks,
            revisit: revisit,
            customerId: customerId,
            revisitContent: revisitContent,
            reservationsId: reservationsId,
            doctorVisitId: doctorVisitId
        },
        success: function (data) {
            Feng.success('操作成功!');
            window.parent.DoctorRevisit.inquire();
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        },
        error: function (data) {
            alert('没有权限，请联系管理员!');
        }
    });
});

$("#submitZl").click(function () {
    var doctor = document.getElementById("doctor").value;   //医生
    var revisit = document.getElementById("revisit").value;   //随访人员
    if((doctor==null||doctor=="") && (revisit==null||revisit=="")){
        alert("请选择医生或随访人员!");
        return;
    }
    var index = layer.open({
        type: 2,
        title: '再随访',
        area: ['60%', '50%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorRevisit/doctor_followUp2'
    });
    this.layerIndex = index;
});

$("#submitZ").click(function () {
    var doctor = document.getElementById("doctor").value;   //医生
    var revisit = document.getElementById("revisit").value;   //随访人员
    if((doctor==null||doctor=="") && (revisit==null||revisit=="")){
        alert("请选择医生或随访人员!");
        return;
    }
    var index = layer.open({
        type: 2,
        title: '再随访',
        area: ['60%', '50%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorRevisit/doctor_followUp2'
    });
    this.layerIndex = index;
});

$("#submitLZ").click(function () {
    var doctor = document.getElementById("doctor").value;   //医生
    var revisit = document.getElementById("revisit").value;   //随访人员
    if((doctor==null||doctor=="") && (revisit==null||revisit=="")){
        alert("请选择医生或随访人员!");
        return;
    }
    var index = layer.open({
        type: 2,
        title: '再随访',
        area: ['60%', '50%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorRevisit/lookedDoctorFollowUp2'
    });
    this.layerIndex = index;
});

$("#submit2").click(function () {
    var doctor = document.getElementById("doctor").value;   //医生
    var createName = document.getElementById("createName").value;  //创建人
    var remarks = document.getElementById("remarks").value;   //随访内容
    var revisit = document.getElementById("revisit").value;   //随访人员
    var revisitContent = document.getElementById("revisitContent").value;   //随访结果
    var reservationsId = document.getElementById("reservationsId").value;   //预约id
    var revisitTime = document.getElementById("revisitTime").value;   //随访时间
    var doctorVisitId = document.getElementById("doctorVisitId").value;   //ID
    if((doctor==null||doctor=="") && (revisit==null||revisit=="")){
        alert("请选择医生或随访人员!");
        return;
    }
    if (revisitTime == null || revisitTime == "") {
        alert("请选择随访时间!");
        return;
    }
    if (remarks == null || remarks == "") {
        alert("请选择随访内容!");
        return;
    }
    $.ajax({
        url: Feng.ctxPath +  "/doctorLooked/updateDoctorContent1",
        type: "post",
        data: {
            doctor: doctor,
            revisitTime: revisitTime,
            createName: createName,
            remarks: remarks,
            revisit: revisit,
            revisitContent: revisitContent,
            reservationsId: reservationsId,
            doctorVisitId: doctorVisitId
        },
        success: function (data) {
            Feng.success('操作成功!');
            window.parent.DoctorRevisit.inquire();
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        },
        error: function (data) {
            alert('没有权限，请联系管理员!');
        }
    });
});

$("#submit3").click(function () {
    var doctor = document.getElementById("doctor").value;   //医生
    var createName = document.getElementById("createName").value;  //创建人
    var remarks = document.getElementById("remarks").value;   //随访内容
    var revisit = document.getElementById("revisit").value;   //随访人员
    var revisitContent = document.getElementById("revisitContent").value;   //随访结果
    var reservationsId = document.getElementById("reservationsId").value;   //预约id
    var revisitTime = document.getElementById("revisitTime").value;   //随访时间
    var doctorVisitId = document.getElementById("doctorVisitId").value;   //ID
    if((doctor==null||doctor=="") && (revisit==null||revisit=="")){
        alert("请选择医生或随访人员!");
        return;
    }
    if (revisitTime == null || revisitTime == "") {
        alert("请选择随访时间!");
        return;
    }
    if (remarks == null || remarks == "") {
        alert("请选择随访内容!");
        return;
    }
    $.ajax({
        url: Feng.ctxPath +  "/doctorLooked/updateDoctorContent2",
        type: "post",
        data: {
            doctor: doctor,
            revisitTime: revisitTime,
            createName: createName,
            remarks: remarks,
            revisit: revisit,
            revisitContent: revisitContent,
            reservationsId: reservationsId,
            doctorVisitId: doctorVisitId
        },
        success: function (data) {
            Feng.success('操作成功!');
            window.parent.DoctorRevisit.inquire();
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        },
        error: function (data) {
            alert('没有权限，请联系管理员!');
        }
    });
});